﻿<Window x:Class="remes.BLoc.UI.BLocProjectDialog"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:sys="clr-namespace:System;assembly=mscorlib"
        xmlns:bloc="clr-namespace:remes.BLoc;assembly=BLocCore"
        Title="Project properties" Width="450" SizeToContent="Height" ShowInTaskbar="False"
        Loaded="Window_Loaded">
  
  <Window.Resources>
    <ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="LocalizationDirectivesToLocFileEnum">
      <ObjectDataProvider.MethodParameters>
        <x:Type TypeName="bloc:LocalizationDirectivesToLocFile"/>
      </ObjectDataProvider.MethodParameters>
    </ObjectDataProvider>
  </Window.Resources>
  
  <DockPanel Margin="3">
    <StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" HorizontalAlignment="Right">
      <Button Content="Apply to VS Project file" x:Name="ApplySettingsButton" Margin="3" Padding="2,1" MinWidth="75" Click="ApplySettingsButton_Click"/>
      <Button Content="Close" x:Name="CloseButton" Margin="3" Padding="2,1" MinWidth="75" IsCancel="True"/>
    </StackPanel>
    
    <Grid Margin="0,2" 
          DataContext="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=Project}">
      <Grid.Resources>
        <Style TargetType="{x:Type TextBlock}">
          <Setter Property="Margin" Value="3,1"/>
          <Setter Property="VerticalAlignment" Value="Center"/>
        </Style>
        <Style TargetType="{x:Type TextBox}">
          <Setter Property="Margin" Value="3,1"/>
          <Setter Property="VerticalAlignment" Value="Center"/>
        </Style>
        <Style TargetType="{x:Type CheckBox}">
          <Setter Property="Margin" Value="3,1"/>
          <Setter Property="VerticalAlignment" Value="Center"/>
        </Style>
        <Style TargetType="{x:Type RadioButton}">
          <Setter Property="Margin" Value="3,1"/>
          <Setter Property="VerticalAlignment" Value="Center"/>
        </Style>
        <Style TargetType="{x:Type ComboBox}">
          <Setter Property="Margin" Value="3,1"/>
          <Setter Property="VerticalAlignment" Value="Center"/>
        </Style>
      </Grid.Resources>
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="Auto"/>
        <ColumnDefinition Width="*"/>
      </Grid.ColumnDefinitions>
      <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto"/>
      </Grid.RowDefinitions>

      <TextBlock Grid.Row="0" Grid.Column="0" Text="Project file path"/>
      <TextBox Grid.Row="0" Grid.Column="1" Text="{Binding Path=ProjectPath, Mode=OneWay}" IsReadOnly="True"/>

      <TextBlock Grid.Row="1" Grid.Column="0" Text="Assembly name"/>
      <TextBox Grid.Row="1" Grid.Column="1" Text="{Binding Path=AssemblyName, Mode=OneWay}" IsReadOnly="True"/>

      <TextBlock Grid.Row="2" Grid.Column="0" Text="Assembly extension"/>
      <TextBox Grid.Row="2" Grid.Column="1" Text="{Binding Path=AssemblyExtension, Mode=OneWay}" IsReadOnly="True"/>

      <TextBlock Grid.Row="3" Grid.Column="0" Text="Configurations"/>
      <ListView Grid.Row="3" Grid.Column="1" Margin="3,1" Height="70" ItemsSource="{Binding Path=Configurations}">
        <ListView.View>
          <GridView AllowsColumnReorder="False">
            <GridViewColumn Header="Condition" DisplayMemberBinding="{Binding Path=Condition}"/>
            <GridViewColumn Header="Output path" DisplayMemberBinding="{Binding Path=OutputPath}"/>
          </GridView>
        </ListView.View>
      </ListView>

      <TextBlock Grid.Row="4" Grid.Column="0" Text="Localization directives to loc file"/>
      <ComboBox Grid.Row="4" Grid.Column="1"
                ItemsSource="{Binding Source={StaticResource LocalizationDirectivesToLocFileEnum}}"
                SelectedItem="{Binding Path=LocalizationDirectivesToLocFile}"/>

      <TextBlock Grid.Row="5" Grid.Column="0" Text="Original culture"/>
      <DockPanel Grid.Row="5" Grid.Column="1">
        <Button DockPanel.Dock="Right" Content="..." Margin="3,1" VerticalAlignment="Center" Padding="2,1" MinWidth="30" x:Name="SelectOriginalLangButton" Click="SelectOriginalLangButton_Click"/>
        <TextBox Text="{Binding Path=OriginalLang, Mode=OneWay}" IsReadOnly="True"/>
      </DockPanel>

      <TextBlock Grid.Row="6" Grid.Column="0" Text="Orig. culture in satelite assembly"/>
      <CheckBox Grid.Row="6" Grid.Column="1" IsChecked="{Binding Path=OriginalLangInSatelite}"/>

      <TextBlock Grid.Row="7" Grid.Column="0" Text="Translation file path"/>
      <TextBox Grid.Row="7" Grid.Column="1" Text="{Binding Path=TranslationFilePath}"/>

      <TextBlock Grid.Row="8" Grid.Column="0" Text="Pre-build actions"/>
      <StackPanel Grid.Row="8" Grid.Column="1" Orientation="Vertical" Margin="0,2">
        <RadioButton Content="None" x:Name="PreBuildActionNoneRadioButton" GroupName="UIDAction" Checked="PreBuildActionRadioButton_Checked"/>
        <RadioButton Content="Check UID's" x:Name="PreBuildActionCheckUIDsRadioButton" GroupName="UIDAction" Checked="PreBuildActionRadioButton_Checked"/>
        <RadioButton Content="Update UID's" x:Name="PreBuildActionUpdateUIDsRadioButton" GroupName="UIDAction" Checked="PreBuildActionRadioButton_Checked"/>
      </StackPanel>

      <TextBlock Grid.Row="9" Grid.Column="0" Text="Post-build actions"/>
      <StackPanel Grid.Row="9" Grid.Column="1" Orientation="Vertical" Margin="0,2">
        <CheckBox Content="Parse assembly" x:Name="PostBuildActionParseAssemblyCheckBox" Checked="PostBuildActionCheckBox_Changed" Unchecked="PostBuildActionCheckBox_Changed"/>
        <CheckBox Content="Generate satelite assemblies" x:Name="PostBuildActionGenerateAssembliesCheckBox" Checked="PostBuildActionCheckBox_Changed" Unchecked="PostBuildActionCheckBox_Changed"/>
      </StackPanel>
    </Grid>
  </DockPanel>
</Window>
